// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Router from 'vue-router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

// import VCharts from 'v-charts'
import '@/styles/index.scss' // global css

import store from './store'

import '@/icons' // icon
import '@/permission' // permission control
import axios from 'axios'
Vue.prototype.$axios = axios

Vue.use(ElementUI)
// Vue.use(VCharts)

const originalPush = Router.prototype.push
Router.prototype.push = function push (location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}
//深拷贝
Vue.prototype.$deepClone = (json)=>{
  if (!json){
    return json;
  }
  return JSON.parse(JSON.stringify(json))
}


Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
